#include <iostream>
#include <algorithm>
using namespace std;
int func(int a)
{
    string s = to_string(a);
    int left = 0, right = s.size() - 1;
    int flag = 0;
    while (left < right)
    {
        if (s[right] == '0' && !flag)
        {
            s[right--] = '\0';
            continue;
        }
        else
        {
            flag = 1;
        }
        swap(s[left++], s[right--]);
    }
    return stoi(s);
}
int main()
{
    int x, k;
    cin >> x;
    if (x >= 0)
    {
        k = 1;
    }
    else
    {
        k = 0;
    }
    int ans = func(x);
    cout << (k ? ans : -ans) << endl;
    return 0;
}
